#ifndef XDRAW_MODULE_H
#define XDRAW_MODULE_H

#ifdef XEXPORTING
#define XEXPORT_DLL __declspec(dllexport)
#else
#define XEXPORT_DLL __declspec(dllimport)
#endif

#include <XWindow.h>

class XEXPORT_DLL XDrawModule
{
private:
	std::vector<XWindow*> WindowQueue;
	std::vector<XRenderPack*> RenderQueue;
	std::vector<XTextPack*> TextQueue;

	static void _render();
	static void _renderXRenderPack(XRenderPack* renderpck);
	static void _renderXTextPack(XTextPack* textpck);
public:
	XDrawModule();

	void RegisterWindow(XWindow* window);
	void UnregisterWindow(XHash hash);

	XRenderPack* AddRenderPack(const char* name);
	XRenderPack* AddRenderPack(XHash hash);
	XRenderPack* GetRenderPack(XHash hash);
	XRenderPack* GetRenderPack(const char* name);
	void DeleteRenderPack(XHash hash);
	void DeleteRenderPack(const char* name);

	XTextPack* AddTextPack(const char* name);
	XTextPack* AddTextPack(XHash hash);
	XTextPack* GetTextPack(XHash hash);
	XTextPack* GetTextPack(const char* name);
	void DeleteTextPack(XHash hash);
	void DeleteTextPack(const char* name);

	void Initialize();
	void PreUpdate();
	void PostUpdate();
	void Exit();

	friend class XGuiModule;
};


#endif